package com.web_bloks.content.client;

import com.google.gwt.user.client.ui.Widget;
import com.web_bloks.user.client.UserMessageServer;
import com.web_bloks.user.client.StatusMessageServer;

/**
 * 
 * @author Jean-Lou Dupont
 *
 */
public interface ViewPage {

	/**
	 * Justs returns a name identifier for the view
	 * @return
	 */
	public String getViewName();

	/**
	 * Sets the input view level parameters.
	 * This method should be called prior to 'getPageName'.
	 * 
	 * @param query
	 * @param reqPage
	 */
	public void setRequestedPageParams(String reqPage, String query);
	
	/**
	 * Executes the 'view' action
	 * @return
	 */
	public void doView();
	
	/**
	 * Returns the resulting 'page name' from the view
	 * @return
	 */
	public String getPageName();
	
	/**
	 * Sets additional parameters for the view. 
	 * This method should be called prior to using the {@link getPageName}
	 * 
	 * @param key
	 * @param value
	 */
	public void setViewParams(String key, String value);
	
	/**
	 * Returns the display widget associated with the view
	 * 
	 * @return widget
	 */
	public Widget getViewWidget();

	/**
	 * Sets the server for publishing messages to the user
	 * 
	 * @param umsg
	 */
	public void setUserMessageServer(UserMessageServer umsg);
	
	/**
	 * Sets the server for the status message to the user
	 * 
	 *  @param statusServer
	 */
	public void setStatusMessageServer(StatusMessageServer status);
	
	/**
	 * Helpful when some parameter(s) changed asynchronously
	 */
	public void doUpdate();
	
}//END